<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<c:set var="nature_value">
    <x:out
            select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value"/>
</c:set>
<c:set var='stat_year'>${param.statyear }</c:set>
<c:set var='curr_year'>${param.curryear }</c:set>
<%-- <x:parse xml="${param.xmlstr}" var="xmlData" /> --%>
<input type="hidden" name="zh_parsen/fzr_name"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
<div class="t_bar"><span class="color_red">*</span>项目基本情况</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
       cellspacing="1" id="projectsituation">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <tr class="li_1">
        <td align="right">项目名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 88%" class="input_css required maxlength:100"
                   maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="项目名称">
        </td>
    </tr>
    <tr class="li_2">
        <td align="right">归口管理单位：</td>
        <td colspan="3">  <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理单位"
                      id="recomend_org"  showPattern="all" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
            <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
    </tr>
    <tr class="li_1">
        <td align="right">证书号码：</td>
        <td colspan="3">
            <input  type="text" label="证书号码" name="proposal/certificate_number" class="input_css required maxlength:18" maxlength="18" value="<x:out select="$xmlData/data/proposal/certificate_number" />" >
        </td>
    </tr>
    <tr class="li_2">
        <td align="right">项目联系人姓名：</td>
        <td>

            <input type="text" name="proposal/contact_psn_cname" class="required" maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />" label="项目联系人姓名">
        </td>
        <td align="right">联系人手机：</td>
        <td>
            <input type="text" name="proposal/contact_psn_mobile" class="required  mobile"
                   onfocus="InitInput.setNumber(this,11,0,0);"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />" label="联系人手机">
        </td>
    </tr>

    <tr class="li_1">
        <td align="right">电子邮箱：</td>
        <td>

            <input type="text" name="proposal/contact_psn_email" class="required email" maxlength="100"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_email" />" label="电子邮箱">
        </td>
        <td align="right">通讯地址：</td>
        <td>
            <input name="proposal/contact_psn_address" label="通讯地址" type="text"  class="input_css required"  maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_address" />"/>
        </td>
    </tr>

    <c:if test="${fn:substring(nature_value,0,1) eq 'A'}">
<tr class="li_2">
    <td align="right">单位类型：</td>
    <td colspan="3">
        <c:set var="org_type"><x:out select="$xmlData/data/proposal/org_type" /></c:set>
        <cpt:checkbox key="enterprise_type" name="proposal/org_type"   value="${org_type }" width="70px;" repeatColumn="4"  style="border: 0px; padding: 0px; margin: 0px;float:left;"  ></cpt:checkbox>
        <input type="hidden" id="org_type" name="proposal/org_type_value"  class="required"  value="<x:out select="$xmlData/data/proposal/org_type_value" />" label="单位类型">
        <input type="hidden" name="proposal/org_type_name" value="<x:out select="$xmlData/data/proposal/org_type_name" />">
    </td>
</tr>
    </c:if>
    <tr class="li_1">
        <td align="right">技术领域：</td>
        <td>
            <input type="text" name="proposal/technology"  class="input_css required " maxlength="50"
                   value="<x:out select="$xmlData/data/proposal/technology"/>" label="技术领域">
        </td>
        <td align="right">申报日期：</td>
        <td colspan="2">
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date" />
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}"
                      className="required date" label="申报日期"></cpt:date>
        </td>
    </tr>
    <tr class="li_2">
        <td align="right" rowspan="2">获得知识产权数量(件)：</td>
        <td align="center">I类</td>
        <td colspan="2"><input type='text' onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;"
                               name="proposal/sub_type_i" id='zh_i' style="width: 80%"
                               class="input_css required maxlength:50"
                               value="<x:out select="$xmlData/data/proposal/sub_type_i" />" label="获得知识产权数量-->I类">
        </td>
    </tr>
    <tr>
        <td align="center">II类</td>
        <td colspan="2"><input type='text' onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;"
                               name="proposal/sub_type_ii" id='zh_ii' style="width: 80%"
                               class="input_css required maxlength:50"
                               value="<x:out select="$xmlData/data/proposal/sub_type_ii" />"
                               label="获得知识产权数量-->II类"></td>
    </tr>
    <tr class="li_2">
        <td align="right" rowspan="2">人力资源情况（人）：</td>
        <td align="center">职工总数</td>
        <td colspan="2" >
            <input type='text' onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;"
                   name="proposal/workers_total"  style="width: 80%"
                   class="input_css required "
                   value="<x:out select="$xmlData/data/proposal/workers_total" />" label="人力资源情况-->职工总数">
        </td>
    </tr>
    <tr>
        <td align="center">科技人员数</td>
        <td colspan="2" > <input type='text' onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;"
                                               name="proposal/technicians_total"  style="width: 80%"
                                               class="input_css required "
                                               value="<x:out select="$xmlData/data/proposal/technicians_total" />" label="人力资源情况-->科技人员数"></td>
    </tr>
    <c:choose>
        <c:when test="${fn:substring(nature_value,0,1) eq 'A'}">
            <tr class="li_2">
                <td align="right">上年销售收入（万元）：</td>
                <td align="center" colspan="3">
	    	<span name="finances/income">
			<c:if test="${stat_year eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/income" />
            </c:if>
			<c:if test="${stat_year+1 eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='3']/income" />
            </c:if>
			<c:if test="${stat_year+2 eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='2']/income" />
            </c:if>
		    </span>
                </td>
            </tr>
            <tr class="li_1">
                <td align="right">上年研发投入（万元）：</td>
                <td align="center">
	    		<span name="finances/yanfa_income" >
			<c:if test="${stat_year eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/yanfa_income" />
            </c:if>
			<c:if test="${stat_year+1 eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='3']/yanfa_income" />
            </c:if>
			<c:if test="${stat_year+2 eq curr_year }">
                <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='2']/yanfa_income" />
            </c:if>
		    </span>
                </td>
                <td align="right">上年度高新技术产品（服务）收入<br/>（万元）：</td>
                <td align="center">
                <span name="finances/income_hightech" >
                    <c:if test="${stat_year eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/income_hightech" />
                    </c:if>
                    <c:if test="${stat_year+1 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='3']/income_hightech" />
                    </c:if>
                    <c:if test="${stat_year+2 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='2']/income_hightech" />
                    </c:if>
                </span>
                </td>
            </tr>
            <tr class="li_2">
                <td align="right">上年净资产（万元）：</td>
                <td align="center">
                    <span name="finances/assets_fixed" >
                    <c:if test="${stat_year eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/assets_fixed" />
                    </c:if>
                    <c:if test="${stat_year+1 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='3']/assets_fixed" />
                    </c:if>
                    <c:if test="${stat_year+2 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='2']/assets_fixed" />
                    </c:if>
                </span>
                </td>
                <td align="right">上年利润总额（万元）：</td>
                <td align="center">
                      <span name="finances/proft_total" >
                    <c:if test="${stat_year eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='5']/proft_total" />
                    </c:if>
                    <c:if test="${stat_year+1 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='3']/proft_total" />
                    </c:if>
                    <c:if test="${stat_year+2 eq curr_year }">
                        <x:out select="$xmlData/data/organization/finances/finance[@sequence_no='2']/proft_total" />
                    </c:if>
                </span>
                </td>
            </tr>
        </c:when>
        <c:otherwise>
            <tr class="li_2">
                <td align="right">上年销售收入：（万元）</td>
                <td align="left">
                    <input type='text' name='finances/income' class="required" id='income'
                           onfocus="InitInput.setNumber(this,7,2,2)" style="text-align: right;"
                           value='<x:out select="$xmlData/data/finances/income"/>' label="上年销售收入">
                </td>
            </tr>
            <tr class="li_1">
                <td align="right">上年研发投入（万元）：</td>
                <td align="left">
                    <input type='text' name='finances/yanfa_income' class="required" id='yanfa_income'
                           onfocus="InitInput.setNumber(this,7,2,2)" style="text-align: right;"
                           value='<x:out select="$xmlData/data/finances/yanfa_income"/>' label="上年研发投入">
                </td>
                <td align="right">上年度高新技术产品（服务）收入<br/>（万元）：</td>
                <td align="left">
                    <input type='text' name='finances/income_hightech' class="required" id='income_hightech'
                           onfocus="InitInput.setNumber(this,7,2,2)" style="text-align: right;"
                           value='<x:out select="$xmlData/data/finances/income_hightech"/>' label="上年度高新技术产品（服务）收入">
                </td>
            </tr>
            <tr class="li_2">
                <td align="right">上年净资产（万元）：</td>
                <td align="left">
                    <input type='text' name='finances/assets_fixed' class="required" id='assets_fixed'
                           onfocus="InitInput.setNumber(this,7,2,2)" style="text-align: right;"
                           value='<x:out select="$xmlData/data/finances/assets_fixed"/>' label="上年净资产">
                </td>
                <td align="right">上年利润总额（万元）：</td>
                <td align="left">
                    <input type='text' name='finances/proft_total' class="required" id='proft_total'
                           onfocus="InitInput.setNumber(this,7,2,2)" style="text-align: right;"
                           value='<x:out select="$xmlData/data/finances/proft_total"/>' label="上年利润总额">
                </td>

            </tr>
        </c:otherwise>
    </c:choose>

    <tr class="li_1">
        <td align="right"><span name="proposal/year1">${stat_year-1}</span>年认定后截止目前是否发生过重大安全、重大质量事故或严重环境违法行为：</td>
        <td colspan="3">
            <cpt:checkbox key="is_or_no" name="proposal/is_no" repeatColumn="3" tagType="radio"></cpt:checkbox>
            <input type="hidden" id="is_no_value" name="proposal/is_no_value" class="required"
                   label="${stat_year-1}年认定后截止目前是否发生过重大安全、重大质量事故或严重环境违法行为"
                   value="<x:out select="$xmlData/data/proposal/is_no_value" />">
            <input type="hidden" name="proposal/is_no_name"
                   value="<x:out select="$xmlData/data/proposal/is_no_name" />">
        </td>
    </tr>
    <tr class="li_2">
        <td align="right">${stat_year-1}年企业科技成果研发和转化主要成效和标志性成果（以数据和典型案例说话，限2000字以内）：</td>
        <td colspan="3">
            <textarea name="proposal/technological_achievements" style="width:98%" class="input_textarea required maxlength:2000"
                      label="${stat_year-1}年企业科技成果研发和转化主要成效和标志性成果" rows=10 cols=60><x:out
                    select="$xmlData/data/proposal/technological_achievements"/></textarea>
            <input type="hidden" name="proposal/technological_achievements_hidden" id="project/technological_achievements_hidden"
                   value="<x:out select="$xmlData/data/proposal/technological_achievements_hidden" />"/>
        </td>
    </tr>

    <tr class="li_1">
        <td align="right">省补助经费拟使用方向（300字以内）：</td>
        <td colspan="3">
            <textarea name="proposal/tech_assign" style="width:98%" class="input_textarea required maxlength:300"
                      label="省补助经费拟使用方向" rows=10 cols=60><x:out
                    select="$xmlData/data/proposal/tech_assign"/></textarea>
            <input type="hidden" name="proposal/tech_assign_hidden" id="project/tech_assign_hidden"
                   value="<x:out select="$xmlData/data/proposal/tech_assign_hidden" />"/>
        </td>
    </tr>
</table>
<script type="text/javascript">
    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }
</script>	